package com.example.demo.utils;

import org.springframework.stereotype.Component;
import org.springframework.util.DigestUtils;

/**
 * @Classname MD5Utils
 * @Description TODO
 * @Date 2021/1/28 17:47
 * @Created by 新
 */
@Component
public class MD5Utils {
	public static final String salt="1a2b3c4d";
	private static String md5(String src){
		return DigestUtils.md5DigestAsHex(src.getBytes());
	}
	public static String inputPassToFromPass(String inputPass){
		String str = "" +salt.charAt(0)+inputPass;
		return md5(str);
	}

	public static void main(String[] args) {
		System.out.println(MD5Utils.inputPassToFromPass("liming"));
	}

}
